home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
elec_eng
/
eepddsk2.lzh
/
INTERMOD.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-02-08
|
4KB
|
96 lines
10 REM ******************************************************************
20 REM ***** "INTERMOD" Mixer Intermod/Harmonic PROGRAM **************
30 REM ***** M.GOLDFARB VERSION 0 NOV.,1983 **************
40 REM ***** M.GOLDFARB VERSION 1 REVISION - MAR.,1984 **************
50 REM ***** M.GOLDFARB VERSION 1 REVISION A JULY,1984 **************
60 REM ***** M.GOLDFARB VERSION 1 REVISION B AUG.,1984 **************
70 REM ***** M.GOLDFARB VERSION 1 REVISION C AUG.,1985 **************
80 REM ******************************************************************
90 CLS ' Clears Screen (IBM & TRS-80)
100 PRINT "INTERMOD - MIXER INTERMOD TABLE VER.1 REV.C M.GOLDFARB AUG 1985"
105 INPUT "OUTPUT TO PRINTER ? ( Y , < N > )";Y$:Y$=LEFT$(Y$,1)
107 IF Y$="Y" OR Y$="y" THEN Y$="Y" ELSE Y$="N"
110 INPUT"LO Frequency Range in GHz (Low,High)";L1,L2
115 IF L2<L1 THEN 110
120 INPUT"RF Frequency Range in GHz (Low,High)";R1,R2
125 IF R2<R1 THEN 120
130 INPUT"Output Frequency Range in GHz (Low,High)";I1,I2
135 IF I2<I1 THEN 130
140 PRINT
150 INPUT"Maximum Product Order (n+m)";Q
160 L=(L1+L2)/2:REM LO Center Freq.:
170 R=(R1+R2)/2:REM RF Center Freq.
180 B2=(R2-R1)/(R*2)
185 A1$="Order RF LO Low Product High Product Product in"
190 B$="(n+m) (m) (n) (mR-nL) (mR+nL) Output Band"
195 C$="## ## ## ###.### to ###.### ###.### to ###.### \ \"
200 D$="_________________________________________________________________"
210 CLS
220 PRINT"********** Mixer Intermodulation/Harmonic Product Table *********"
225 PRINT
226 IF Y$="N" THEN 235
227 LPRINT"********** Mixer Intermodulation/Harmonic Product Table *********"
229 LPRINT
230 LPRINT "LO Frequency Range : ";L1;" GHz to ";L2;" GHz"
231 LPRINT "RF Frequency Range : ";R1;" GHz to ";R2;" GHz"
232 LPRINT "Output Frequency Range: ";I1;" GHz to ";I2;" GHz":LPRINT
233 LPRINT
234 LPRINT A1$:LPRINT B$
235 PRINT A1$:PRINT B$:PRINT D$
240 I=8 ' Page Counter
250 M=0
260 N=Q ' start loop with n= max.order
320 GOSUB 1000 ' calculate products for given order "Q"
330 A$="n": REM test for spur in the output band
331 HL=0
332 IF V1>=I1 AND V1<=I2 THEN A$="HIGH"
334 IF V2>=I1 AND V2<=I2 THEN A$="HIGH"
336 IF V1>=I1 AND V2<=I2 THEN A$="HIGH"
338 IF V1<=I1 AND V2>=I2 THEN A$="HIGH"
339 IF A$="HIGH" THEN HL=1
340 IF U1>=I1 AND U1<=I2 THEN A$="LOW"
350 IF U2>=I1 AND U2<=I2 THEN A$="LOW"
360 IF U1>=I1 AND U2<=I2 THEN A$="LOW"
362 IF U1<=I1 AND U2>=I2 THEN A$="LOW"
363 IF A$="LOW" AND HL=1 THEN A$="BOTH"
364 IF M=1 AND N=1 THEN A$="output"
366 IF N+M=4 THEN PRINT:I=I-1
367 IF N+M=4 AND Y$="Y" THEN LPRINT
370 IF I=0 THEN INPUT" < return> to continue";X$
371 IF I>0 THEN 380
372 CLS
373 PRINT
374 PRINT A1$:PRINT B$:PRINT D$
376 PRINT:I=8
377 IF Y$="Y" THEN LPRINT
380 PRINT USING C$;N+M,M,N,U1,U2,V1,V2,A$
382 IF Y$="Y" THEN LPRINT USING C$;N+M,M,N,U1,U2,V1,V2,A$
385 I=I-1
390 N=N-1
395 IF M=0 AND N=0 THEN 410
400 IF N>=0 THEN 320
410 M=M+1:N=Q-M
415 PRINT
420 IF M<=Q THEN 320
430 PRINT
435 IF Y$="y" OR Y$="Y" THEN LPRINT CHR$(12)
437 INPUT "New Table <N> or Quit <Q>";X$:X$=LEFT$(X$,1)
440 IF X$="N" OR X$="n" THEN 60
450 IF X$="Q" OR X$="q" THEN CLS:SYSTEM
460 PRINT:GOTO 437
1000 REM *********** Subroutine: CALCSPUR
1010 IF M*R>=N*L THEN X=1 ELSE X=0
1015 Y=0
1020 IF X=0 AND N*L1>M*R2 THEN Y=1
1030 IF X=1 AND M*R1>N*L2 THEN Y=1
1040 IF Y=0 THEN U1=0
1050 IF Y=1 AND X=0 THEN U1=N*L1-M*R2
1060 IF Y=1 AND X=1 THEN U1=M*R1-N*L2
1070 IF X=0 THEN U2=N*L2-M*R1 ELSE U2=M*R2-N*L1
1080 V1=M*R1+N*L1
1090 V2=M*R2+N*L2
1100 IF M=0 THEN U1=N*L1
1110 IF N=0 THEN U1=M*R1
1120 RETURN
32767 END